﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web.UI;

using LMD.Constant;
using LMD.Lib.Oracle;
using LMD.Lib.Controls;

public class LOV_ICPCAR : LMD.Lib.Interface.ILOVProvider
{
    public LOV_ICPCAR()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    #region ILOVProvider Members

    public String DrawLOV(string sxControlId, string sxFilter, string sxCustomParam, int iIndex, int iPageSize)
    {
        sxFilter = sxFilter.Trim();
        Cached.ICPCARTable ccICPCAR = new Cached.ICPCARTable();
        DataTable dtICPCAR;
        if (!String.IsNullOrEmpty(sxCustomParam) && !sxCustomParam.Equals("-1"))
        {
            int iCompanyId = int.Parse(sxCustomParam);
            dtICPCAR = ccICPCAR.GetCARListByCompany(iCompanyId);
        }
        else
        {
            dtICPCAR = ccICPCAR.GetCARList();
        }

        return CustomControls.Create_LOVDrawer(sxControlId, dtICPCAR, iIndex, iPageSize, sxFilter, "EMPLOYEE_NO", "EMPLOYEE_NAME", "SelectCAR()", false);
    }


    public String ShowInputForm(string sxControlId, string sxValue, string sxCustomParam)
    {
        String sxOutput = String.Empty;
        sxOutput = CustomControls.BuildEditor_PopupNewLOVItem(sxControlId, GetLOVName(), sxValue, false);
        return sxOutput;
    }

    public string GetLOVName()
    {
        return KLOV.Generic.ICPCAR;
    }

    public string Insert2LOV(string sxValue, string sxCustomParam, TextboxType tpTextbox)
    {
        throw new NotImplementedException();
    }

    #endregion
}
